package com.gm.wj.dao;

import com.gm.wj.entity.WorkPublish;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;
import java.util.List;

public interface WorkPublishDAO extends JpaRepository<WorkPublish,Integer> {

    WorkPublish findWorkPublishById(Integer id);

    List<WorkPublish> findWorkPublishByPublisher(Integer publisher);


    @Modifying
    @Transactional
    @Query("delete from WorkPublish where id in (?1)")
    Integer deleteWorkPublishs(List<Integer> ids);
}
